import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { Input, Card, Button } from 'antd';
import { KehuFrom } from './KehuFrom';
// import moment from 'moment';
// import api from '../../utils/api';
import BreadcrumbCustom from '../../components/BreadcrumbCustom';

class Permision extends Component {
  constructor(props) {
    super(props);
    this.state = {
      showAddModal: false
    };
  }

  componentDidMount() {}

  addNews = () => {
    this.setState({
      showAddModal: true
    });
  }

  clossModal = () => {
    this.setState({
      showAddModal: false
    });
  }

  render() {
    const { showAddModal } = this.state;
    return (
      <Fragment>
        <BreadcrumbCustom first="账户权限" second="角色管理" />
        <div className="permision-content">
          <div className="permision-content-header">
            <Card>
              客户账号: <Input style={{ width: 200, marginRight: 10 }} placeholder="请输入客户账号" />
              <Button type="primary" htmlType="button" onClick={this.onSearchData} style={{ marginRight: 10 }}>查询</Button>
              <Button type="primary" htmlType="button" onClick={this.addNews}>新增客户</Button>
            </Card>
          </div>
          <div className="permision-content-main">

          </div>
        </div>
        <KehuFrom
          showAddModal={showAddModal}
          clossModal={this.clossModal}
        />
      </Fragment>
    );
  }
}

const mapStateToProps = (state, ownProps) => ({});

const mapDispatchToProps = dispatch => ({
  actions: bindActionCreators(
    {},
    dispatch,
  ),
});

export default connect(mapStateToProps, mapDispatchToProps)(Permision);
